//
//  FirstTouchFooterView.m
//  EMMApp
//
//  Created by 无常先生 on 2018/8/20.
//  Copyright © 2018年 YiXun. All rights reserved.
//

#import "FirstTouchFooterView.h"

@interface FirstTouchFooterView () <UITextViewDelegate>
@property (weak, nonatomic) IBOutlet UITextView *textView;

@property (weak, nonatomic) IBOutlet UILabel *placeholderLable;

@end

@implementation FirstTouchFooterView

+ (instancetype)loadView {
    
    FirstTouchFooterView *view = [[NSBundle mainBundle]loadNibNamed:@"FirstTouchFooterView" owner:nil options:nil].lastObject;
    view.frame = CGRectMake(0, 0, EMM_WIDTH, 90);
    return view;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.textView.delegate = self;
}
- (void)textViewDidChange:(UITextView *)textView {
    self.placeholderLable.hidden = textView.hasText;
}

-(void)setNote:(NSString *)note {
    _note = note;
    self.textView.text = note;
    if (note.length) {
        self.placeholderLable.hidden = YES;
        self.textView.userInteractionEnabled = NO;
    }
}

- (NSString *)nowNote {
    return self.textView.text;
}
- (void)setActive:(BOOL)active {
    _active = active;
    self.textView.userInteractionEnabled = active;
}

@end
